# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-w3af-api-client
_pkgname=w3af-api-client
pkgver=3.0.1
pkgrel=7
epoch=1
pkgdesc='REST API client to consume w3af.'
arch=('any')
url='https://pypi.org/project/w3af-api-client/#files'
license=('GPL2')
depends=('python' 'python-requests')
makedepends=('python-setuptools' 'python-pip' 'python-wheel')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('b03e5d0f99eff88cd5119887b2a7ad4658c8899ac4da47205c89174874ff9d531e34070793ce10cf16522825d341cae4cccbdfe08ec6256b883461a8c8bfde58')

prepare() {
  cd "$_pkgname-$pkgver"

  sed "/from w3af_api_client import __VERSION__/d" -i setup.py
  sed "s|version=__VERSION__|version='3.0.1'|g" -i setup.py
  sed "/install_requires=requires('requirements.txt'),/d" -i setup.py
}

build() {
  cd "$_pkgname-$pkgver"

  python setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

